const express = require("express");
const router = express.Router();
const fs = require("fs");
const ResponseHelper = require("../ResponseHelper");
// const os = require('os');
// const system =  os.platform();
const fileUrl = require("../../tools/fileUrl");

let PUBLIC_PATH = `${fileUrl.PUBLIC_PATH}`;
// if(system === 'linux'){
//   PUBLIC_PATH = "/home/ubuntu/config3.json"
// }

router.get("/", (req, res, next) => {
  fs.readFile(PUBLIC_PATH, async (err, data) => {
    if (err) {
      console.log("读取错误", err);
    }
    let readRes = JSON.parse(data);
    ResponseHelper.sendData(readRes, res);
  });
});

module.exports = router;
